<div class="row fixed-nav">
	<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0; background: rgba(10,20,23,255);">
		<!-- 左侧导航栏收起按钮 -->
		<div class="navbar-header" style="margin-left: 20px;">
			<a class="navbar-minimalize minimalize-styl-2 btn btn-primary" href="#" style="position: absolute;left: 300px;"><i class="fa fa-bars"></i> </a>
			<%= link_to image_tag('logo.png'), root_path, style: "margin-top: 18px; margin-left: 20px; display: block;" %>
		</div>
		<!-- 左侧导航栏收起按钮  end-->
		<!-- 右上角消息提示部分 -->
		<ul class="nav ace-nav navbar-top-links navbar-right">
			<!-- 机房选择 -->
			<li>
				<%= link_to alert_room_path(@room), class: "js-ref-page", 'data-url': refersh_alert_room_path(@room) do %>
				  告警 <span class="badge badge-danger" id="js-alert-num"><%= @alerts.length %></span>
				<% end %>
			</li>
			<li class="dropdown">
				<a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
					<i class="fa fa-home fa-lg"></i>机房<b class="caret"></b>
				</a>
				<ul class="dropdown-menu">
					<% current_user.rooms.each do |room| %>
						<li><%= link_to room.name, room_path(room) %></li>
					<% end %>
				</ul>
			</li><!-- 机房选择end -->
			<li>
				<%= link_to "javascript: void(0)" do %>
					<i class="fa fa-user"></i> <%= current_user.name %>
				<% end %>
			</li>
			<li>
				<%= link_to destroy_user_session_path, method: :delete do %>
					<i class="fa fa-sign-out"></i> 退出
				<% end %>
			</li>
		</ul>
		<!-- 右上角消息提示部分 end-->
	</nav>
</div>

<script type="text/javascript">
  var url = $(".js-ref-page").data('url');
  function refreshPartial() {
	  $.ajax({
	    url: url
	 })
	}
	setInterval(refreshPartial, 5000)
</script>